package cn.itsource.pay.controller;


import cn.itsource.basic.util.AjaxResult;
import cn.itsource.pay.domain.UserAddress;
import cn.itsource.pay.service.IUserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/address")
public class UserAddressController {
    @Autowired
    private IUserAddressService userAddressService;

    /**
     * 获取当前登录用户的地址们
     *
     */
    @RequestMapping("/findUserAddresses")
    private AjaxResult findUserAddresses(){

        //1.获取地址们
        List<UserAddress> addresses = userAddressService.findUserAddresses();
        //2.返回
        return AjaxResult.createSuccess(addresses);
    }

}
